#include "at24c02_eeprom.h"

void at24c02_write_onebyte(u8 addr,u8 dat)
{
	iic_start();
	iic_write_byte(0XA0);
	iic_wait_ask();
	iic_write_byte(addr);
	iic_wait_ask();
	iic_write_byte(dat);
	iic_wait_ask();
	iic_end();
	delay_ms(10);
}

u8 at24c02_read_onebyte(u8 addr)
{
	u8 temp=0;
	iic_start();
	iic_write_byte(0XA0);
	iic_wait_ask();
	iic_write_byte(addr);
	iic_wait_ask();
	iic_start();
	iic_write_byte(0XA1);
	iic_wait_ask();
	temp=iic_read_byte(0);
	iic_end();
	return temp;
}